package com.sunricher.telinkblemeshlib.callback;


import com.sunricher.telinkblemeshlib.MeshCommand;
import com.sunricher.telinkblemeshlib.MeshDevice;
import com.sunricher.telinkblemeshlib.MeshDeviceType;
import com.sunricher.telinkblemeshlib.MeshManager;

import java.util.ArrayList;
import java.util.Date;
import java.util.Map;

public abstract class DeviceCallback {

    public void didUpdateMeshDevices(MeshManager manager, ArrayList<MeshDevice> meshDevices) {
    }

    public void didUpdateDeviceType(MeshManager manager, int address, MeshDeviceType deviceType, byte[] macData) {
    }

    public void didGetDate(MeshManager manager, int address, Date date) {
    }

    public void didGetLightGammaCurve(MeshManager manager, int address, byte gamma) {
    }

    public void didGetLightOnOffDuration(MeshManager manager, int address, int duration) {
    }

    public void didGetFirmwareVersion(MeshManager manager, int address, String version) {
    }

    public void didGetGroups(MeshManager manager, int address, ArrayList<Integer> groups) {
    }

    public void didGetDeviceAddress(MeshManager manager, int address) {
    }

    public void didGetLightRunningMode(MeshManager manager, int address, MeshCommand.LightRunningMode mode) {
    }

    public void didGetLightRunningModeIdList(MeshManager manager, int address, ArrayList<Integer> idList) {
    }

    public void didGetLightRunningModeId(MeshManager manager, int address, int modeId, int colorsCount, int colorIndex, MeshCommand.LightRunningMode.Color color) {
    }

    public void didGetLightSwitchType(MeshManager manager, int address, int switchType) {
    }

    public void didGetLightPwmFrequency(MeshManager manager, int address, int frequency) {
    }

    public void didGetRgbIndependenceState(MeshManager manager, int address, boolean isEnabled) {
    }

    /**
     * @param manager
     * @param address
     * @param isNegative    Timezone is negative?
     * @param hour          Timezone hour
     * @param minute        Timezone minute
     * @param sunriseHour
     * @param sunriseMinute
     * @param sunsetHour
     * @param sunsetMinute
     */
    public void didGetTimezone(MeshManager manager, int address, boolean isNegative, int hour, int minute, int sunriseHour, int sunriseMinute, int sunsetHour, int sunsetMinute) {
    }

    public void didGetLocation(MeshManager manager, int address, float longitude, float latitude) {
    }

    public void didGetSunriseSunsetAction(MeshManager manager, int address, MeshCommand.SunriseSunsetAction action) {
    }

    public void didGetScene(MeshManager manager, int address, MeshCommand.Scene scene) {
    }

    public void didGetAlarm(MeshManager manager, int address, MeshCommand.AbstractAlarm alarm) {
    }

    /**
     *
     * @param manager
     * @param address
     * @param groupSyncTag "NONE": 没有同步主机; "BYTES_16": 当前使用的同步主机 Tag; "BYTES_32": 不需要处理。
     * @param group
     */
    public void didGetGroupSyncHost(MeshManager manager, int address, String groupSyncTag, int group) {
    }

    /**
     * @param manager
     * @param address  Device address.
     * @param switchId If value is 0 means is not a valid switch ID.
     * @param index    Index of the smart switch.
     * @param count    Total smart switch count.
     */
    public void didGetSmartSwitchId(MeshManager manager, int address, long switchId, int index, int count) {
    }

    /**
     * When received a sensor report, manager will recall this callback.
     *
     * @param manager
     * @param address Sensor address.
     * @param value Report value. The Key is MeshCommand.SensorReportKey, and the value is depend on the Key, you need to convert it yourself.
     */
    public void didSensorReport(MeshManager manager, int address, Map<String, Object> value) {
    }

    /**
     * When get a sensor attribute value, manager will recall this callback.
     *
     * @param manager
     * @param address Sensor address.
     * @param value Sensor value. The Key is MeshCommand.SensorAttributeType (Integer), and the value is a Integer.
     */
    public void didGetSensorAttribute(MeshManager manager, int address, Map<Integer, Object> value) {
    }

    // DO THIS LATER
    // public void didGetSensorEventAction(MeshManager manager, int address, int event, Object action) {}

    /**
     * red [0, 255], green [0, 255], blue [0, 255], brightness[ 0, 100], white [0, 255], cct [0, 100].
     *
     * Note: If brightness equals 0 that means the device is turned off.
     *
     * let whitePercentage = round(float(white) / 2.55))
     */
    public void didRespondStatus(MeshManager manager, int address, int red, int green, int blue, int white, int cct, int brightness, boolean isOn, int r1, int r2) {}

    public void didGetPowerOnState(MeshManager manager, int address, int level) {}

    public void didGetSensorId(MeshManager manager, int address, long sensorId, int sensorType) {}

    public void didGetSensorAction(MeshManager manager, int address, int sensorEvent, MeshCommand.SensorAction action) {}

    // remoteIndex: 1, 2
     public void didGetUniversalRemoteId(MeshManager manager, int address, String remoteId, int remoteIndex) {}

    public void didGetUniversalRemoteShortLongAction(MeshManager manager, int address, MeshCommand.UniversalRemoteAction shortAction, MeshCommand.UniversalRemoteAction longAction, int remoteIndex) {}

    public void didGetUniversalRemoteRotationAction(MeshManager manager, int address, MeshCommand.UniversalRemoteAction rotationAction, int remoteIndex) {}
}